/*
 * ThreadFibo.java
 */
import java.util.*;
public class ThreadFibo implements Runnable {
	private int n;
	private Vector result;
	private Thread t;
	
	public ThreadFibo(int n) {
		this.n = n;
		t = new Thread(this);
		t.start();
		result = new Vector();
	}// end default constructor
	
	public void run() {
		
		fib(n);
	}// end method run
	
	public int fib(int n) {
		if (n == 0 || n == 1)
		    return n;
		else
		    return fib (n - 1) + fib (n - 2);
	}// end method fib5
	

	public Thread getThread() {
		return t;
	}// end method getThread
	
	public Vector getResult() {
		return result;
	}// end method getResult
	
	public String toString() {
		return result.toString();
	}// end method toString
}// end class ThreadFibo
